import request from '@/utils/request'

interface IMenuPermissionsResp {
  list: IPermission[]
}

/**
 * 查询所有的菜单权限数据
 * @returns 
 */
export const getAllMenuPermissions = () => request.get<any, IMenuPermissionsResp>('/api/v1/admin/permissions')

/**
 * 添加菜单权限数据
 */
export const addMenuPermission = (data: IPermission) => request.post('/api/v1/admin/permissions', data)

/**
 * 修改菜单权限数据
 */
export const updateMenuPermission = (data: IPermission) => request.put('/api/v1/admin/permissions/' + data.id, data)

/**
 * 删除菜单权限数据
 */
export const deleteMenuPermission = (id: string) => request.delete('/api/v1/admin/permissions/' + id)
